{include file="header.tpl"}

<div id="block_featured" class="block">
	<img src="images/theme/ribbon.png" class="ribbon"/>
	<span class="ribbon_text">{$title}</span>
    <div class="block_inside">
	
	{$info_action}
	
	<div class="user_panel">
		<ul class="tabs">
			<li><a href="#tab1">Praktyki</a></li>
			<li><a href="#tab2">Praktykanci</a></li>
			<!--<li><a href="#tab3">Dane firmy</a></li>
			<li><a href="#tab4">Pracownicy</a></li>-->
		</ul>

		<div class="tab_container">
			<div id="tab1" class="tab_content">	
				<div class="table_div">
					<form method="post" id="show_practices">
						<a href="new_practice.php" class="button b_blue" style="color: white; text-decoration: none;">Dodaj nową praktykę</a><br/><br/>
						<table id="practices" class="tablesorter">
							<thead>
								<tr style="color:#789;font-weight: bold">
									<th></th>
									<th>Lp.</th>
									<th>Numer</th>
									<th>Data dodania</th>
									<th>Data rozpoczęcia</th>
									<th>Data zakończenia</th>
									<th>Liczba miejsc</th>
									<th>Status</th>
									<th>Akcje</th>
								</tr>
							</thead>
							<tbody>
								{if !empty($practices)}
									{foreach item=practice from=$practices name=practice}
									{if $practice.status == 1}
									<tr style="background-color :#C1FFC1">
									{elseif $practice.status == -1}
									<tr style="background-color :#FA8072">									
									{else}
									<tr style="background-color:{cycle values=#F6F6F6,white}">
									{/if}
										<td><input type="checkbox" name="cb[]" id="cb[]" value="{$practice.id}"/></td>
										<td>{$smarty.foreach.practice.iteration}</td>
										<td>{$practice.id}</td>
										<td>{$practice.add_date}</td>
										<td>{$practice.date_start}</td>
										<td>{$practice.date_end}</td>
										{if $practice.amount > 0}
											<td>{$practice.amount}</td>
										{else}
											<td><img src="images/user--minus.png"/></td>
										{/if}
										<td>
											{if $practice.status == 0}
												<img src="images/flag-yellow.png"/>
											{elseif $practice.status == 1} 	
												<img src="images/flag-green.png"/>
											{elseif $practice.status == 2} 	
												<img src="images/flag-black.png"/>	
											{elseif $practice.status == -1} 	
												<img src="images/flag--exclamation.png"/>
											{/if}
										</td>
										<td>
											<a href ="practice_details.php?id={$practice.id}" class="extLink" >
												<img src="images/magnifier-left.png"/>
											</a>	
											<a href ="user_panel.php?remove_id={$practice.id}" >
												<img src="images/cross.png"/>
											</a>
											<a href ="user_panel.php?finish_id={$practice.id}" >
												<img src="images/calendar--minus.png"/>
											</a>
										</td>
									</tr>
									{/foreach}
								{else}
									<tr>
										<td colspan="7">Brak ofert praktyk.</td>
									</tr>			
								{/if}
							</tbody>
						</table>
						<input type="button"  value="Zaznacz" onclick="jqCheckAll('show_practices', 'cb[]', 1);" class="button b_blue"/>
						<input type="button"  value="Odznacz" onclick="jqCheckAll('show_practices', 'cv[]', 0);" class="button b_blue"/>
						<input type="submit" name="delete" id="delete" value="Usuń" class="button b_red"/>
					</form>
					<div>

						<br/>
						<br/>
						<div class="legend">
							<img src="images/flag-yellow.png"/> - praktyka oczekuje na akceptację<br/>
							<img src="images/flag--exclamation.png"/> - praktyka odrzucona przez administratora<br/>
							<img src="images/flag-green.png"/> - praktyka zaakceptowana<br/>
							<img src="images/flag-black.png"/> - praktyka zakończona<br/>
						</div>
					</div>
				</div>			
			</div>
			<div id="tab2" class="tab_content">
				<div class="table_div">
					<form method="post" id="show_practices">
						<table id="practices" class="tablesorter">
							<thead>
								<tr style="color:#789;font-weight: bold">
									<th>Lp.</th>
									<th>Numer praktyki</th>
									<th>Imię</th>
									<th>Nazwisko</th>
									<th>Email</th>
									<th>Status</th>
									<th>Akcje</th>
								</tr>
							</thead>
							<tbody>
								{if !empty($students)}
									{foreach item=s from=$students name=student}
									{if $s.status == 1}
									<tr style="background-color :#C1FFC1">
									{elseif $s.status == -1}
									<tr style="background-color :#FA8072">									
									{else}
									<tr style="background-color:{cycle values=#F6F6F6,white}">
									{/if}
										<td>{$smarty.foreach.student.iteration}</td>
										<td>{$s.practice_id}</td>
										<td>{$s.student_name}</td>
										<td>{$s.student_surname}</td>
										<td>{$s.email}</td>
										<td>
											{if $s.status == 0}
												<img src="images/flag-yellow.png"/>
											{elseif $s.status == 1} 	
												<img src="images/flag-green.png"/>
											{elseif $s.status == 2} 	
												<img src="images/flag-black.png"/>	
											{elseif $s.status == -1} 	
												<img src="images/flag--exclamation.png"/>
											{/if}
										</td>
										<td>
											<a href ="student_details.php?id={$s.id}" class="extLink" >
												<img src="images/magnifier-left.png"/>
											</a>	
											<a href ="user_panel.php?remove_id={$s.id}" >
												<img src="images/cross.png"/>
											</a>
											<a href ="user_panel.php?finish_id={$s.id}" >
												<img src="images/calendar--minus.png"/>
											</a>
										</td>
									</tr>
									{/foreach}
								{else}
									<tr>
										<td colspan="7">Aktualnie brak praktykantów.</td>
									</tr>			
								{/if}
							</tbody>
						</table>
					</form>
				</div>				
			</div>
			<div id="tab3" class="tab_content">
			</div>
			<div id="tab4" class="tab_content">
			</div>
		</div>
	</div>
</div>
</div>
{include file="footer.tpl"}